<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no,email=no" name="format-detection">
    <title>首页-{$tpshop_config['shop_info_store_title']}</title>
    <link rel="stylesheet" href="http://wxv2.lppz.com/shop_resource/wechat/css/app.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/public.css"/>
    <script src="http://wxv2.lppz.com/shop_resource/wechat/js/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/iscroll.css"/>
    <script type="text/javascript" src="__STATIC__/js/iscrollv4.2.5.js"></script>

<script >
var Tday = new Array();
var daysms = 24 * 60 * 60 * 1000
var hoursms = 60 * 60 * 1000
var Secondms = 60 * 1000
var microsecond = 1000
var DifferHour = -1
var DifferMinute = -1
var DifferSecond = -1

function clock11(key)
{
   var time = new Date()
   var hour = time.getHours()
   var minute = time.getMinutes()
   var second = time.getSeconds()
   var timevalue = ""+((hour > 12) ? hour-12:hour)
   timevalue +=((minute < 10) ? ":0":":")+minute
   timevalue +=((second < 10) ? ":0":":")+second
   timevalue +=((hour >12 ) ? " PM":" AM")
   var convertHour = DifferHour
   var convertMinute = DifferMinute
   var convertSecond = DifferSecond
   var Diffms = Tday[key].getTime() - time.getTime()
   DifferHour = Math.floor(Diffms / daysms)
   Diffms -= DifferHour * daysms
   DifferMinute = Math.floor(Diffms / hoursms)
   Diffms -= DifferMinute * hoursms
   DifferSecond = Math.floor(Diffms / Secondms)
   Diffms -= DifferSecond * Secondms
   var dSecs = Math.floor(Diffms / microsecond)
  
  if(convertHour != DifferHour) e="<span class=hour>"+DifferHour+"</span>天";
   if(convertMinute != DifferMinute) f="<span class=min>"+DifferMinute+"</span>时";
   if(convertSecond != DifferSecond) g="<span class=sec>"+DifferSecond+"</span>分";
     h="<span class=msec>"+dSecs+"</span>秒";
     if (DifferHour>0) {e=e}
     else {e=''}
     //document.getElementById("jstimerBox"+key).innerHTML = e + f + g + h; 
     return (e + f + g + h);
}

</script>
<style>

		.cc_icon{
			position:absolute;
			left:0;
			top:0;
			z-index:100;
			width:20%;
		}
		.deline{
			text-decoration:line-through;
			color:#999;
			font-size:12px;
			font-weight:bold;
		}
		.ad-mcube-list{max-height:inherit!important;}
		.search-header .search-form input{
			background: url(/public/static/images/mobile/index/top_search_bg.png) no-repeat 35px 50% #eee;
		}
		.custom-goods{background: #D6E7F7;padding: 2px;}
		.ad-mcube-list{background: #D6E7F7;}
		.goods-buy .icon-shop_cart{
			background: url(__STATIC__/images/category/cart.png) no-repeat center center;
			height: 30px;
			width: 40px;
			background-size: 30px 30px;
			display: block;
			}
		.label-prom{color:#fff;display: block;width:40px;height: 40px;position: absolute;top:0;background: url(__STATIC__/images/label-prom.png) no-repeat center top;background-size:90%;text-align: center;font-size: 14px;font-weight: bold;line-height: 26px}
		.label-red{background: red;width:20px;height: 20px;border-radius: 5px;padding:0px 2px;color:#fff;font-size:11px;font-style: normal;}
		.z-time{position: absolute;bottom: 10px;width:100%;color:#fff;text-align: center;opacity: 0.5;height: 20px;line-height: 20px;text-align: center;}
		.z-time div{display: block;width:93%;background: #D5006A;height: 20px;line-height: 20px;margin:0 auto;}
		
		</style>

		<script type="text/javascript">

		    var myScroll,pullDownEl, pullDownOffset,pullUpEl, pullUpOffset;
		    var labeltext1="继续上拉,查看详情";
		    var labeltext2="";
		    var labeltext3="继续上拉,查看详情";
		    var generatedCount = 0;


		    function pullDownAction () {
		        myScroll.refresh(); 
		     }

		     function pullUpAction () {
		       getGoodsList();
		        
		     }
		     var page = 1;
		     function getGoodsList(){
		     	var url = "/index.php?m=Mobile&c=Index&a=ajaxGetMore&type={$type}&p="+page;
		     	$.ajax({
		     		type : "get",
		     		url:url,
		     		success: function(data)
		     		{
		     			console.log(data);
		     			if(data){
		     				$("#J_ItemList>ul").append(data);
		     				page++;
		     				
		     			}else{
		     				labeltext3="没有了哦";
		     			}
		     			myScroll.refresh(); 
		     		}
		     	}); 
		     }


		    function loaded() {
		        pullDownEl = document.getElementById('pullDown');
		        pullDownOffset = pullDownEl.offsetHeight;
		        pullUpEl = document.getElementById('pullUp'); 
		        pullUpOffset = pullUpEl.offsetHeight;
		
		        myScroll = new iScroll('wrapper', {
		            useTransition: true,
		            topOffset: pullDownOffset,
		            onRefresh: function () {
		                if (pullDownEl.className.match('loading')) {
		                    pullDownEl.className = '';
		                    pullDownEl.querySelector('.pullDownLabel').innerHTML = labeltext2;
		                } else if (pullUpEl.className.match('loading')) {
		                    pullUpEl.className = '';
		                    pullUpEl.querySelector('.pullUpLabel').innerHTML = labeltext3;
		                }
		            },
		            onScrollMove: function () {
		                if (this.y > 5 && !pullDownEl.className.match('flip')) {
		                    pullDownEl.className = 'flip';
		                    pullDownEl.querySelector('.pullDownLabel').innerHTML = '释放加载...';
		                    this.minScrollY = 0;
		                } else if (this.y < 5 && pullDownEl.className.match('flip')) {
		                    pullDownEl.className = '';
		                    pullDownEl.querySelector('.pullDownLabel').innerHTML = 'Pull down to refresh...';
		                    this.minScrollY = -pullDownOffset;
		                } else if (this.y < (this.maxScrollY - 5) && !pullUpEl.className.match('flip')) {
		                    pullUpEl.className = 'flip';
		                    pullUpEl.querySelector('.pullUpLabel').innerHTML ="释放加载..." ;
		                    this.maxScrollY = this.maxScrollY;
		                } else if (this.y > (this.maxScrollY + 5) && pullUpEl.className.match('flip')) {
		                    pullUpEl.className = '';
		                    pullUpEl.querySelector('.pullUpLabel').innerHTML = labeltext3;
		                    this.maxScrollY = pullUpOffset;
		                }
		            },
		            onScrollEnd: function () {
		                if (pullDownEl.className.match('flip')) {
		                    pullDownEl.className = 'loading';
		                    pullDownEl.querySelector('.pullDownLabel').innerHTML = 'Loading...';        
		                    pullDownAction(); // Execute custom function (ajax call?)
		                } else if (pullUpEl.className.match('flip')) {
		                    pullUpEl.className = 'loading';
		                    pullUpEl.querySelector('.pullUpLabel').innerHTML = 'Loading...';        
		                    pullUpAction(); // Execute custom function (ajax call?)
		                }
		            }
		        });
		
		        setTimeout(function () { document.getElementById('wrapper').style.left = '0'; }, 800);
		    }

		    //上拉加载关闭开启

		    document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

		    document.addEventListener('DOMContentLoaded', function () { setTimeout(loaded, 200); }, false);
		</script>
</head>

<body class="has-foot-nav">  
	<!-- 顶部搜索 -->
	 <header class="search-header fixed-bar">
		<div class="fixed-bar-area bd-btm">
	  		<div class="search-back"><a href="javascript:history.go(-1)"><i class="picon icon-back"></i></a></div>
	  		<div class="search-form">
	  			<input class="sch-ipt form-input search-go-page" type="text" name="" id="search-text" value="">
	  			<i class="picon icon-sch-ipt"></i>
	  			<a class="picon icon-circle-delete" href="javascript:;"></a>
	  		</div>
	  		<div class="search-link"><a href="javascript:void(0)" onclick="subsearch()">搜索</a></div>
  		</div>
  	</header>
  	<div class="scroll-wrapper" id="wrapper"> 
  		<div id="scroller">
  		<div id="pullDown">
           <span class="pullDownIcon"></span><span class="pullDownLabel"></span>
       </div>
		<div class="ad-mcube-list clearfix" type="type1">
		    <div class="mcube-item">
		    <if condition="$type eq 'indexwoman'">
		       <adv pid="407" limit="1" item="v">
				<img class="goods-photo lazyimg" src="/public/static/images/mobile/img_default@4x1.png" data-src="{$v[ad_code]}" >
				</adv> 
			<elseif condition="$type eq 'indexman'">
				<adv pid="409" limit="1" item="v">
				<img class="goods-photo lazyimg" src="/public/static/images/mobile/img_default@4x1.png" data-src="{$v[ad_code]}" >
				</adv> 
			<elseif condition="$type eq 'shopindex'">
				<adv pid="410" limit="1" item="v">
				<img class="goods-photo lazyimg" src="/public/static/images/mobile/img_default@4x1.png" data-src="{$v[ad_code]}" >
				</adv> 
			</if>
			</div>
			<div class="mcube-item">
			       <adv  pid="408" limit="1" item="v">
					<img class="goods-photo lazyimg" src="/public/static/images/mobile/img_default@4x1.png" data-src="{$v[ad_code]}" usemap="#planetmap">
					<map name="planetmap" id="planetmap">
						<area shape="rect" coords="0,0,320,200" href ="/index.php/Mobile/Shop/index/type/indexwoman.html" />
						<area shape="rect" coords="320,0,640,200" href ="/index.php/Mobile/Shop/index/type/indexman.html"/>
					</map>
					</adv> 
				</div>
			<div style="clear:both"></div>
		</div> 

		<div class="custom-image-swiper">
			<div class="slider-main custom-slider">
				<adv pid='2' limit='8' item='v'>
					<div class="slider-item"><a href="{$v.ad_link}"><img class="lazyslide" src="http://wxv2.lppz.com/shop_resource/wechat/images/slider_default.png" data-src="{$v[ad_code]}" alt=""></a></div>
				</adv>
			</div>
		</div>


		<div class="custom-goods" id="J_ItemList">
			<ul class="sc-goods-list clearfix two-col show ">
			    
			</ul>
			
		</div>
		 
		<div id="pullUp">
           <span class="pullUpIcon"></span><span class="pullUpLabel">继续上拉，加载更多</span>
       </div>
       <div id="getmore" style="text-align: center;color:#888;height: 50px; clear:both">
      	
    	</div>  
		</div>
	</div>
	 

<script>
	document.body.style.background = "#fff";
</script> 
<script type="text/javascript">

$(function(){
	getGoodsList();
});


</script> 


<!-- 搜索 -->
<div class="search-wrapper"></div>
<!-- 购物车&返回顶部  -->
<div class="page-fix-button">
	<!--<div class="store-cart"><a class="picon icon-store-cart" href="http://wxv2.lppz.com/cart/index.jhtml">购物车</a><span></span></div> -->
	<div class="goto-top"><a class="picon icon-go-top" href="#">返回顶部</a></div>
</div>

<!-- 底部导航-->
<!-- 底部菜单 -->
<!-- 底部菜单 -->
<include file="public/footer_nav"/>

<!-- 底部JS -->
<script type="text/javascript">  
 
        //搜索
       function subsearch(){
       	var wp=$('#search-text').val();
       	location.href="{:U('Goods/search')}?q="+wp;
       }
</script>  

<script src="http://wxv2.lppz.com/shop_resource/wechat/js/app.js"></script>
</body>
</html>